use DB_HR
go
create table tb_department
(dno char(5) not null primary key,
dname char(10) not null)

create table tb_position
(pno char(5) not null primary key,
dname char(10) not null)


create table tb_employee
(eno char(5) not null primary key,
ename char(10) not null,
esex char(2) not null default 'Ů',
eage int not null ,
edu char(10) not null,
eaddress varchar(50) null,
etel char(11) null,
wbirth date null,
dno char(5) not null,
pno char(5) not null)

create table tb_basicsalary
(basicid char(5) not null primary key,
basicsal decimal(10,2) not null)

create table tb_additional
(addid char(5) not null primary key,
addmoney decimal(10,2) not null)

create table tb_salary
(eno char(5) not null primary key,
basicid char(5) not null,
addid char(5) not null,
salary numeric(10,2) null,
srealsal numeric(10,2) null,
stax numeric(10,2) not null)

create table tb_trainproject
(tno char(5) not null primary key,
tname char(50) not null,
tdays int not null ,
ttrainunit varchar(50) not null,
taddress varchar(50) null,
tprice numeric(10,2) not null)


create table tb_train
(eid int  not null primary key,
eno char(5) not null,
tno char(5) not null,
ttime  datetime not null,
passtrain varchar(20) not null,
trainca varchar(30) null)


